package com.gpStudy.design.observer;

import java.util.Observable;
import java.util.Observer;

public class Teachet implements Observer {

    private String userName;

    public Teachet(String userName) {
        this.userName = userName;
    }

    public void update(Observable o, Object arg) {

        // 1. 强转类型
//        GPer gPer = (GPer) o;
        Question question = (Question) arg;
        System.out.println("==============================================");
        System.out.println(this.userName+",你好：");
        System.out.println("你的学生"+question.getUserName()+"向你提出了一个问题：");
        System.out.println(question.getContent());

        o.hasChanged();

    }
}
